<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>로그인</title>
<script type="text/javascript">
function checkInput(){
	var form = document.loginForm;
	if(!form.id.value){
		alert("ID를 입력하세요");
		form.id.focus();
		return false;
	}
	if(!form.password.value){
		alert("패스워드를 입력하세요");
		form.password.focus();
		return false;
	}
}
function searchId(){
	//팝업을 띄우기
	window.open("res/member/search_id.jsp","search_id","width=450,height=300,resizable=no");//첫번째가 팝업을 띄었을때 보여지게 될 화면 URL이고 두번째는 뜨는 화면에다가 이름을 주는것(이름을 안주게 되면 팝업이 계속 뜬다)
}
function searchPassword(){
	//팝업을 띄우기
	window.open("res/member/search_password.jsp","search_password","width=450,height=300,resizable=no");//첫번째가 팝업을 띄었을때 보여지게 될 화면 URL이고 두번째는 뜨는 화면에다가 이름을 주는것(이름을 안주게 되면 팝업이 계속 뜬다)
}
</script>
</head>
<body>
로그인 폼<br>   
<hr noshade="noshade" width="30%" align="left"><p> 
<c:if test="${requestScope.error_message != null}">
	<font color="red" size="2">${requestScope.error_message}</font>
</c:if>
<c:if test="${requestScope.logout_message != null}">
	<font color="red" size="2">${requestScope.logout_message}</font><p>
</c:if>
<c:if test="${requestScope.remove_message != null}">
	<font color="red" size="2">${requestScope.remove_message}</font><p>
</c:if>
<a href="/${initParam.context_root }/res/member/member_register.jsp"><b>회원가입</b></a>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:searchId();">아이디</a>/
<a href="javascript:searchPassword();">비밀번호 찾기</a>
<form name="loginForm" action="/${initParam.context_root }/login.do" method="post" onsubmit="return checkInput()">

	<table>
		<tr>
			<td>아이디</td>
			<td><input type="text" name="id" size="20"/></td>
		</tr>
		<tr>
			<td>패스워드</td>
			<td><input type="password" name="password" size="20"/></td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<input type="submit" value="로그인"/>
				<input type="reset" value="초기화"/>
			</td>
		</tr>
	</table>	
</form>
</body>
</html>